package com.burstly.lib.component.networkcomponent.burstly.html;

import android.content.Context;
import android.view.View;
import com.burstly.lib.component.ComponentState;
import com.burstly.lib.component.IBurstlyAdaptor;
import com.burstly.lib.component.IBurstlyAdaptor.BurstlyAdType;
import com.burstly.lib.component.IBurstlyAdaptor.TransactionCode;
import com.burstly.lib.component.IBurstlyAdaptorListener;
import com.burstly.lib.component.IClickTracker;
import com.burstly.lib.component.ITrackClickResponseHandler;
import com.burstly.lib.component.networkcomponent.burstly.AbstractBurstlyAdaptor;
import com.burstly.lib.network.beans.ResponseBean.ResponseData;
import com.burstly.lib.network.beans.ResponseBean.ResponseData.AdType;
import com.burstly.lib.util.Utils;
import java.util.Map;

public final class BurstlyScriptAdaptor
  implements IBurstlyAdaptor, IClickTracker
{
  public static final String NETWORK_NAME = "burstlyScript";
  private final String mBurstlyViewId;
  private ComponentState mComponentState;
  private Context mContext;
  private AbstractBurstlyAdaptor mCurrentAdaptor;

  public BurstlyScriptAdaptor(Context paramContext, String paramString)
  {
    this.mBurstlyViewId = paramString;
    this.mContext = paramContext;
  }

  public void destroy()
  {
    this.mCurrentAdaptor.destroy();
    this.mContext = null;
    this.mComponentState = null;
  }

  public void endTransaction(IBurstlyAdaptor.TransactionCode paramTransactionCode)
  {
    this.mCurrentAdaptor.endTransaction(paramTransactionCode);
  }

  public void endViewSession()
  {
    this.mCurrentAdaptor.endViewSession();
  }

  public IBurstlyAdaptor.BurstlyAdType getAdType()
  {
    return this.mCurrentAdaptor.getAdType();
  }

  public String getNetworkName()
  {
    return "burstlyScript";
  }

  public View getNewAd()
  {
    return this.mCurrentAdaptor.getNewAd();
  }

  public ITrackClickResponseHandler getResponseHandler()
  {
    return this.mCurrentAdaptor.getResponseHandler();
  }

  public void pause()
  {
    this.mCurrentAdaptor.pause();
  }

  public View precacheAd()
  {
    return this.mCurrentAdaptor.precacheAd();
  }

  public void precacheInterstitialAd()
  {
    this.mCurrentAdaptor.precacheInterstitialAd();
  }

  public void resume()
  {
    this.mCurrentAdaptor.resume();
  }

  public void setAdaptorListener(IBurstlyAdaptorListener paramIBurstlyAdaptorListener)
  {
    this.mCurrentAdaptor.setAdaptorListener(paramIBurstlyAdaptorListener);
  }

  public void showPrecachedInterstitialAd()
  {
    this.mCurrentAdaptor.showPrecachedInterstitialAd();
  }

  public void startTransaction(Map<String, ?> paramMap)
    throws IllegalArgumentException
  {
    this.mComponentState = ((ComponentState)paramMap.get("componentState"));
    ResponseBean.ResponseData.AdType localAdType = this.mComponentState.getResponseData().getAdType();
    if (Utils.isRewards(this.mComponentState.getResponseData().getDataType()))
      this.mCurrentAdaptor = new RewardsScriptAdaptor(this.mContext, this.mBurstlyViewId);
    while (true)
    {
      this.mCurrentAdaptor.startTransaction(paramMap);
      return;
      if (Utils.isOrmma(localAdType))
        this.mCurrentAdaptor = new OrmmaBurstlyScriptAdaptor(this.mContext, this.mBurstlyViewId);
      else if (Utils.isMraid(localAdType))
        this.mCurrentAdaptor = new MraidBurstlyScriptAdaptor(this.mContext, this.mBurstlyViewId);
      else
        this.mCurrentAdaptor = new BurstlyBaseScriptAdaptor(this.mContext, this.mBurstlyViewId);
    }
  }

  public void startViewSession()
  {
    this.mCurrentAdaptor.startViewSession();
  }

  public void stop()
  {
    if (this.mCurrentAdaptor != null)
      this.mCurrentAdaptor.stop();
  }

  public boolean supports(String paramString)
  {
    return this.mCurrentAdaptor.supports(paramString);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.component.networkcomponent.burstly.html.BurstlyScriptAdaptor
 * JD-Core Version:    0.6.2
 */